package net.sky.oa.test.dao.system;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import net.sky.oa.dao.system.SysDeptDao;
import net.sky.oa.model.SysDept;
import net.sky.oa.test.BaseTestCase;

import org.junit.Test;
import org.springframework.test.annotation.Rollback;

public class SysDeptDaoTestCase extends BaseTestCase {

	@Resource
	private SysDeptDao sysDeptDao;

	@Test
	@Rollback(false)
	public void add() {
		SysDept sysDept = new SysDept();
		sysDept.setName("TestDeptName1");
		sysDept.setCreatetime(new Date());
		sysDept.setMobile("13537720409");
		this.sysDeptDao.save(sysDept);
	}

	@Test
	@Rollback(false)
	public void find() {

		List<SysDept> depts = this.sysDeptDao.findAllDept();
		for (SysDept dept : depts) {
			System.out.println("getName:" + dept.getName());
		}
	}
}